const userinfoKey = 'userinfo'			// 存储用户信息
const tokenKey = 'token'						// 存储访问令牌
const xTokenKey = 'x-token'					// 存储刷新令牌

export default {
	setUserinfo(data) {
		uni.setStorageSync(userinfoKey, data)
	},
	getUserinfo() {
		return uni.getStorageSync(userinfoKey)
	},
	setToken(token) {
		uni.setStorageSync(tokenKey, token[tokenKey])
		uni.setStorageSync(xTokenKey, token[xTokenKey])
	},
	getToken() {
		var token = {}
		token[tokenKey] = uni.getStorageSync(tokenKey)
		token[xTokenKey] = uni.getStorageSync(xTokenKey)
		return token
	}
	
}